import type {
  // 系列类型的定义后缀都为 SeriesOption
  BarSeriesOption,
  LineSeriesOption,
  PieSeriesOption,
  MapSeriesOption,
  GaugeSeriesOption,
  RadarSeriesOption,
  ScatterSeriesOption,
  GraphSeriesOption,
  HeatmapSeriesOption,
  TreeSeriesOption,
} from "echarts/charts";
import type {
  // 组件类型的定义后缀都为 ComponentOption
  LegendComponentOption,
  TitleComponentOption,
  TooltipComponentOption,
  GridComponentOption,
  DatasetComponentOption,
  TimelineComponentOption,
  DataZoomComponentOption,
  MarkLineComponentOption,
  MarkPointComponentOption,
  MarkAreaComponentOption,
} from "echarts/components";
import type { ComposeOption } from "echarts/core";

type LinearDirection = "vertical" | "horizontal";

// 通过 ComposeOption 来组合出一个只有必须组件和图表的 Option 类型
type ECOption = ComposeOption<
  | LegendComponentOption
  | BarSeriesOption
  | LineSeriesOption
  | TitleComponentOption
  | TooltipComponentOption
  | GridComponentOption
  | DatasetComponentOption
  | PieSeriesOption
  | MapSeriesOption
  | GaugeSeriesOption
  | RadarSeriesOption
  | ScatterSeriesOption
  | GraphSeriesOption
  | HeatmapSeriesOption
  | TreeSeriesOption
  | TimelineComponentOption
  | DataZoomComponentOption
  | MarkLineComponentOption
  | MarkPointComponentOption
  | MarkAreaComponentOption
>;

export type { LinearDirection, ECOption };
